package model;

import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.AnnotationConfiguration;
import org.hibernate.tool.hbm2ddl.SchemaExport;

public class GerarTabelas {

	private static AnnotationConfiguration cfg;
	private static SessionFactory factory;
	private static Session session;

	public static void main(String[] args) {
		cfg = new AnnotationConfiguration();
		cfg.addAnnotatedClass(Administrador.class);
		cfg.addAnnotatedClass(Cliente.class);
		cfg.addAnnotatedClass(Produto.class);
		cfg.addAnnotatedClass(ControladorDeEstoque.class);
		cfg.addAnnotatedClass(Fornecedor.class);
		cfg.addAnnotatedClass(Vendedor.class);
		cfg.addAnnotatedClass(Lote.class);
		cfg.addAnnotatedClass(Venda.class);
		cfg.addAnnotatedClass(Caixa.class);
		factory = cfg.buildSessionFactory();
		session = factory.openSession();
		SchemaExport se = new SchemaExport(cfg);
		se.create(true, true);
	}
}
